addr, ptwr_info[cpu].disconnected << L2_PAGETABLE_SHIFT));
pl2e = &linear_l2_table[ptwr_info[cpu].disconnected];
- if (__get_user(pte, writable_pte))
- BUG();
+ if (__get_user(pte, writable_pte)) {
+ MEM_LOG("ptwr: Could not read pte at %p\n", writable_pte);
+ domain_crash();
+ }
pfn = pte >> PAGE_SHIFT;
page = &frame_table[pfn];
continue;
if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT))
put_page_from_l1e(ol1e, current);
- if (unlikely(!get_page_from_l1e(nl1e, current)))
- BUG();
+ if (unlikely(!get_page_from_l1e(nl1e, current))) {
+ MEM_LOG("ptwr: Could not re-validate l1 page\n");
+ domain_crash();
+ }
}
unmap_domain_mem(pl1e);
update_l2e(pl2e, *pl2e, nl2e);
frame_table[pfn].u.inuse.domain->domain));
ptwr_info[cpu].disconnected = ENTRIES_PER_L2_PAGETABLE;
/* make pt page write protected */
- if (__get_user(pte, writable_pte))
- BUG();
+ if (__get_user(pte, writable_pte)) {
+ MEM_LOG("ptwr: Could not read pte at %p\n", writable_pte);
+ domain_crash();
+ }
PTWR_PRINTK(("[A] writable_l1 at %p is %08lx\n",
writable_pte, pte));
pte &= ~_PAGE_RW;
- if (__put_user(pte, writable_pte))
- BUG();
+ if (__put_user(pte, writable_pte)) {
+ MEM_LOG("ptwr: Could not update pte at %p\n", writable_pte);
+ domain_crash();
+ }
__flush_tlb_one(ptwr_info[cpu].writable_l1);
PTWR_PRINTK(("[A] writable_l1 at %p now %08lx\n",
writable_pte, pte));
for (idx = 0; idx < ptwr_info[cpu].writable_idx; idx++) {
unsigned long *writable_pte = (unsigned long *)&linear_pg_table
[ptwr_info[cpu].writables[idx]>>PAGE_SHIFT];
- if (__get_user(pte, writable_pte))
- BUG();
+ if (__get_user(pte, writable_pte)) {
+ MEM_LOG("ptwr: Could not read pte at %p\n", writable_pte);
+ domain_crash();
+ }
pfn = pte >> PAGE_SHIFT;
page = &frame_table[pfn];
PTWR_PRINTK(("[I] alloc l1 page %p\n", page));
continue;
if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT))
put_page_from_l1e(ol1e, current);
- if (unlikely(!get_page_from_l1e(nl1e, current)))
- BUG();
+ if (unlikely(!get_page_from_l1e(nl1e, current))) {
+ MEM_LOG("ptwr: Could not re-validate l1 page\n");
+ domain_crash();
+ }
}
unmap_domain_mem(pl1e);
PTWR_PRINTK(("[I] writable_l1 at %p is %08lx\n",
writable_pte, pte));
pte &= ~_PAGE_RW;
- if (__put_user(pte, writable_pte))
- BUG();
+ if (__put_user(pte, writable_pte)) {
+ MEM_LOG("ptwr: Could not update pte at %p\n", writable_pte);
+ domain_crash();
+ }
__flush_tlb_one(ptwr_info[cpu].writables[idx]);
PTWR_PRINTK(("[I] writable_l1 at %p now %08lx\n",
writable_pte, pte));
PTWR_PRINTK(("update %p pte to %08lx\n",
&linear_pg_table[addr>>PAGE_SHIFT], pte));
if ( __put_user(pte, (unsigned long *)
- &linear_pg_table[addr>>PAGE_SHIFT]) )
- BUG();
+ &linear_pg_table[addr>>PAGE_SHIFT]) ) {
+ MEM_LOG("ptwr: Could not update pte at %p\n", (unsigned long *)
+ &linear_pg_table[addr>>PAGE_SHIFT]);
+ domain_crash();
+ }
return 1;
}
}
page = &frame_table[pde >> PAGE_SHIFT];
/* assert that page is an l1_page_table XXXcl maybe l2? */
- if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table )
- BUG();
+ if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table ) {
+ MEM_LOG("ptwr: Inconsistent pagetable: pde %x is not an l1 page\n",
+ pde >> PAGE_SHIFT);
+ domain_crash();
+ }
page->u.inuse.type_info &= ~PGT_va_mask;
page->u.inuse.type_info |= va_idx << PGT_va_shift;
}
unsigned long *writable_pte = (unsigned long *)&linear_pg_table
[ptwr_info[cpu].writables[i]>>PAGE_SHIFT];
- if ( __get_user(pte, writable_pte) )
- BUG();
+ if ( __get_user(pte, writable_pte) ) {
+ MEM_LOG("ptwr: Could not read pte at %p\n", writable_pte);
+ domain_crash();
+ }
pfn = pte >> PAGE_SHIFT;
page = &frame_table[pfn];
ptwr_info[cpu].disconnected << L2_PAGETABLE_SHIFT);
pl2e = &linear_l2_table[ptwr_info[cpu].disconnected];
- if ( __get_user(pte, (unsigned long *)ptwr_info[cpu].writable_l1) )
- BUG();
+ if ( __get_user(pte, (unsigned long *)ptwr_info[cpu].writable_l1) ) {
+ MEM_LOG("ptwr: Could not read pte at %p\n", (unsigned long *)
+ ptwr_info[cpu].writable_l1);
+ domain_crash();
+ }
pfn = pte >> PAGE_SHIFT;
page = &frame_table[pfn];